<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <base href="">
    <!-- 当前正在使用的模板 -->
    <!-- 精彩活动-->
    <!-- 新闻-->
    <!-- 品牌-->
    <!-- 类型-->
    <!-- 分类-->
    <!--活动-->

    <title>宝马5系/三厢/2.0自动</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="宝马5系/三厢/2.0自动">
    <meta http-equiv="description" content="宝马5系/三厢/2.0自动">
    <link rel="stylesheet" type="text/css" href="template/default/css/index.css">
</head>

<body id="allBody">


<!-- 主导航 -->
<!--网站基本信息-->
<!-- 当前正在使用的模板 -->
<div class="header">
    <div class="header_fun_bg">
        <div class="mainbox header_fun_info">
            尊敬的客户，欢迎您来到成都维熵科技有限责任公司
            <div class="right">


                <a href="pc/pcUserIndex">用户中心 </a>|
                <a href="pc/pcLoginOut">退出</a>

                |<a href="#">网站导航</a>
                |<a href="auto/19.html">帮助中心</a>
            </div>
        </div>
    </div>
    <div class="header_menu_bg">
        <div class="mainbox header_menu_info">
            <a href="" class="header_logo"><img
                    src="upload/4/6/614d6017-c01b-482d-8840-b2667665437a_20161213110129129.png"/></a>
            <ul class="header_menu">


                <li>
                    <a href="index/1.html">首页</a>
                </li>

                <li>
                    <a href="goods/7.html">自驾租车</a>
                </li>

                <li>
                    <a href="service/8.html">企业服务</a>
                </li>

                <li>
                    <a href="auto/23.html">精彩活动</a>
                </li>

                <li>
                    <a href="auto/21.html">新闻中心</a>
                </li>

                <li>
                    <a href="auto/6.html">联系我们</a>
                </li>

                <li class="app"><span class="header_menu_mobile"><a href="javascript:void(0)">手机版</a></span></li>
                <li class="phone"><img src="template/default/images/header_logo_phone.jpg"/></li>

            </ul>
        </div>
    </div>
    <div class="clear sales">
        <div class="left order_car_contain">
            <div class="order_car_infobox">
                <div class="left order_car_til">基本信息</div>
                <div class="left order_car_full"></div>
                <div class="clear"></div>
                <div class="order_car_info">
                    <div class="left order_car_img"><img th:src="@{${cart.cartPic}}"/></div>
                    <div class="left car_info_cs">
                        <div class="b_name car_info_til" th:text="${cart.name}">宝马5系/三厢/2.0自动</div>
                        <div class="car_info_cs_li">
                            <ul>


                                <li class="lang_box"><span class="b_name">车系</span><span
                                        th:text="${cart.series}">5系</span></li>


                                <li class="lang_box"><span class="b_name">年代款</span><span
                                        th:text="${#dates.format(cart.time,'yyyy')}">2012</span></li>


                                <li class="lang_box"><span class="b_name">配置款</span><span
                                        th:text="${cart.cartype}"></span></li>


                                <li class="lang_box"><span class="b_name">座位数</span><span th:text="${cart.seat}"></span>
                                </li>


                                <li class="lang_box"><span class="b_name">车门数</span>4</li>


                                <li class="lang_box"><span class="b_name">燃料类型</span>汽油</li>


                                <li class="lang_box"><span class="b_name">变速箱类型</span>AT</li>


                                <li class="lang_box"><span class="b_name">排量</span>1997</li>


                                <li class="lang_box"><span class="b_name">燃油标号</span> 95-97汽油</li>


                                <li class="lang_box"><span class="b_name">驱动方式</span>前驱</li>


                                <li class="lang_box"><span class="b_name">发动机进气形式</span>涡轮增压</li>


                                <li class="lang_box"><span class="b_name">天窗</span>单天窗</li>


                                <li class="lang_box"><span class="b_name">油箱容量</span>70</li>


                                <li class="lang_box"><span class="b_name">音响</span>8</li>


                                <li class="lang_box"><span class="b_name">座椅</span>皮革座椅</li>


                                <li class="lang_box"><span class="b_name">倒车雷达</span>有</li>


                                <li class="lang_box"><span class="b_name">气囊</span>5</li>


                                <li class="lang_box"><span class="b_name">GPS导航</span>有</li>


                            </ul>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="add_renter_tit"><span>选择租车人信息</span></div>
                <div class="clear"></div>
                <div class="address_list">
                    <ul id="address_list">

                        <li th:each="u:${users}">
                            <input id="tem_address_id" name="tem_address_id" type="radio" th:value="${u.id}">
                            <span th:text="${u.username}"></span>-
                            联系电话：<span th:text="${u.phone}"></span>
                            -身份证号码：<span th:text="${u.idCard}"></span>
                        </li>

                    </ul>
                </div>
                <div class="clear"></div>

                <div class="clear"></div>
                <div class="add_renterinfo">
                    <div class="left">
                        <form action="javascript:void(0)" name="addressForm" id="addressForm" method="post">
                            <input name="cartId" type="hidden" class="renter_name" th:value="${cart.id}"/>
                            姓名：<input name="username" type="text" class="renter_name"/>
                            身份证号码：<input type="text" name="idCard" class="idcard"/>
                            联系电话：<input type="text" name="phone" class="renter_type"/>
                            <input type="hidden" name="password" class="renter_type" value="123"/>

                        </form>
                    </div>
                    <div class="add_renter_sub" onclick="addAddress()">添加租车人信息</div>
                    <span id="addressMsg"></span>
                </div>
                <div class="clear"></div>
            </div>

            <form action="javascript:void(0)" name="orderForm" id="orderForm" method="post">
                <input name="address_id" id="address_id" type="hidden" value=""/>
                <input name="goods_id" id="goods_id" type="hidden" value="34"/>

                <input type="hidden" name="content" id="content" value=""/>
                <input type="hidden" name="desc" id="desc" value=""/>


                <div class="order_car_infobox " style="margin-top:20px;">
                    <div class="left order_car_til">接送机</div>
                    <div class="left order_car_full"></div>
                    <div class="clear"></div>
                    <div class="order_car_info order_car_inplay">
                        <input name="inner_price" id="inner_price" type="hidden" value="250">
                        <input name="outer_price" id="outer_price" type="hidden" value="300">
                        <div class="clear play_radio">
                            <select name="tem_desc" id="tem_desc" onchange="getOuterOrInner()">
                                <option value="">--接送机请选择--</option>
                                <option value="1">三环内</option>
                                <option value="2">三环外</option>
                            </select>
                            只有接送机的项目可以选择
                        </div>
                    </div>
                </div>

                <div class="order_car_infobox " style="margin-top:20px;">
                    <div class="left order_car_til">优惠活动</div>
                    <div class="left order_car_full"></div>
                    <div class="clear"></div>
                    <div class="order_car_info order_car_inplay">

                        <div class="clear play_radio">
                            使用 <input name="play_yh" class="renter_name" id="crrent_integel" value=""> 积分（当前积分：<font
                                color="red">0分</font>，此商品可以使用1）20个积分相当于1元钱<br/>
                        </div>
                    </div>
                </div>

                <div class="order_car_infobox " style="margin-top:20px;">
                    <div class="left order_car_til">费用明细</div>
                    <div class="left order_car_full"></div>
                    <div class="clear"></div>
                    <!-- 商务用车和旅游用车 -->

                    <!-- 接机 -->

                    <!--						<div class="order_car_infos">-->
                    <!--							<div class="order_car_moninfo" style="line-height:35px;">车辆租赁费<span class="mx_zhus">（注：包含车辆租赁使用费、司机服务费、油费、机场高速过路费，免费超时等待30分钟，若超出等待时间收费80元/小时，行程结束后收取）</span></div>-->
                    <!--							<div class="order_car_moninfo"><input value="夜间服务" name="add_items" id="yejian" type="checkbox" />夜间服务<span class="mx_zhus">（注：夜间服务时间为21:00-8:00，收取费用为100元，行程结束前收取）</span></div>-->
                    <!--							<div class="order_car_moninfo"><input name="add_items" id="xuyaofapiao" value="需要发票" type="checkbox" name="add_items"/>需要发票<span class="mx_zhus">（注：开发票加收17%税金，费用结算后为您寄出）</span></div>-->
                    <!--							<div class="order_car_moninfo">备注信息</div>-->
                    <!--							<div class="order_car_moninfo"><textarea name="ext_text" id="ext_text" class="remark_area"></textarea></div>-->
                    <!--						</div>-->


                    <div class="order_sub">
                        <div>


                            应付金额：

                            <span>￥<span class="shiji_order" id="shiji_order">250</span></span>
                        </div>

                        <input type="hidden" name="price" id="price" value="250"/>
                        <!--                        <input type="button" value="提交订单" onclick="javascript:submit_order()"-->
                        <!--                               class="right order_sub_btn"/>-->
                        <span id="submitMsg"></span>
                        <input type="button" value="提交订单" onclick="submit_order1()"
                               class="right order_sub_btn"/>
                        <div class="clear"></div>
                    </div>
                    <div class="clear"></div>
                </div>
            </form>
        </div>

        <!--右侧模块-->


        <div class="right sales_type_more">
            <div class="sales_more_til">精彩活动<a href="jingcaihuodong/22.html" class="right">更多&gt;&gt;</a></div>
            <ul class="sales_more_play">
                <!-- 精彩活动-->


                <li>
                    <a href="page/50.html">
                        <img src="upload/15/2/2bfbaffa-07c0-4c2e-821a-bea290d24247_20161213124009409.jpg"/>
                        <span>春节租车开放预订 先下手为强！</span>
                    </a>
                </li>

                <li>
                    <a href="page/51.html">
                        <img src="upload/1/2/7f28ae28-ff14-4663-b609-a1eda1b0e606_201612131243284328.jpg"/>
                        <span>新用户专享，150元见面礼</span>
                    </a>
                </li>

                <li>
                    <a href="page/52.html">
                        <img src="upload/7/11/53e044d7-cf68-4dcb-9601-a3fd47d936e6_201612131244344434.jpg"/>
                        <span>不惧严寒 多地租车提供雪地胎</span>
                    </a>
                </li>

                <li>
                    <a href="page/53.html">
                        <img src="upload/11/12/54d36b6e-acc6-44ff-8714-46a909e628e1_201612131245484548.jpg"/>
                        <span>西宁租3送1 速来免费用车！</span>
                    </a>
                </li>

                <li>
                    <a href="page/54.html">
                        <img src="upload/6/3/f09e3df5-06a7-4860-8dc9-d3154fca0f86_201612131247134713.jpg"/>
                        <span>“泉”心“泉”意享暖冬</span>
                    </a>
                </li>

            </ul>
        </div>
    </div>
</div>


<!-- 当前正在使用的模板 -->
<!-- 网站基本信息-->
<div class="clear footer">
    <ul class="clear list_info">
        <!--帮助中心的菜单 -->


        <li><span>租车预订</span>
            <ul class=" clear list_info_oline">

                <li><a href="auto/19.html">服务时间</a></li>

                <li><a href="auto/20.html">服务预订</a></li>

            </ul>
        </li>

        <li><span>会员服务</span>
            <ul class=" clear list_info_oline">

            </ul>
        </li>

        <li><span>常见问题</span>
            <ul class=" clear list_info_oline">

            </ul>
        </li>

        <li><span>我们的服务</span>
            <ul class=" clear list_info_oline">

            </ul>
        </li>


        <li class="list_info_ew"><img src="template/default/images/share_icon_gz.jpg"/>
            <p>关注微信公众号</p></li>
        <li class="list_info_ew"><img src="template/default/images/share_icon_sj.jpg"/>
            <p>下载手机版</p></li>
    </ul>
    <div class="clear"></div>
    <ul class="footer_address">
        <li>
            <span class="left address_icon">&nbsp;</span>
            <!-- 门店系统-->
            <p class="left">

                天府新谷：府城大道399号2号楼5楼</br>

            </p>
        </li>
        <li>
            <span class="left phone_icon">&nbsp;</span>
            <p class="left">24小时免费热线电话</br><span class="font_phone">028-85980903</span></p>
        </li>
        <li class="text-right">

        </li>
    </ul>
    <div class="clear"></div>
    <div class="footer_links">
        <div class="left">友情链接：</div>
        <ul class="right">
            <!--友情链接-->


            <li>
                <a href="http://www.webapi.cn" target="_blank">成都维熵科技</a>
            </li>

        </ul>
    </div>
    <div class="clear footer_copyright">
        <p class="left">成都维熵科技有限责任公司</p>
        <p class="right">如果您对成都维熵科技有限责任公司有任何意见，欢迎发送联系电话:028-85980903</p>
    </div>
</div>


<style>

    /* leftsead */
    #leftsead {
        width: 161px;
        height: 290px;
        position: fixed;
        top: 250px;
        right: 0px;
        z-index: 100;
    }

    * html #leftsead {
        margin-top: 258px;
        position: absolute;
        top: expression(eval(document.documentElement.scrollTop));
    }

    #leftsead li {
        width: 161px;
        height: 60px;
        list-style: none;
    }

    #leftsead li img {
        float: right;
    }

    #leftsead li a {
        height: 49px;
        float: right;
        display: block;
        min-width: 47px;
        max-width: 161px;
        margin-right: 0px;
    }

    #leftsead li a .shows {
        display: block;
    }

    #leftsead li a .hides {
        margin-right: -143px;
        cursor: pointer;
        cursor: hand;
    }

    #leftsead li a.youhui .hides {
        display: none;
        position: absolute;
        right: 143px;
    }

    #leftsead li a.youhui

    .2
    wm {
        display: none;
        position: absolute;
        right: 143px;
    }

    #p2 {
        width: 112px;
        background-color: #A7D2A9;
        height: 47px;
        margin-left: 47px;
        border: 1px solid #8BC48D;
        text-align: center;
        line-height: 47px
    }

    #p3 {
        width: 112px;
        background-color: #EC9890;
        height: 47px;
        margin-left: 47px;
        border: 1px solid #E6776C;
        text-align: center;
        line-height: 47px
    }

    #p1 {
        width: 47px;
        height: 49px;
        float: left
    }
</style>
<!-- 代码部分begin -->
<div id="leftsead">
    <ul>
        <li id="btn">
            <a href="javascript:void(0)">
                <div class="hides" style="width:161px;display:none">
                    <img src="template/default/images/ll05.png" width="161" height="49">
                </div>
                <img src="template/default/images/l05.png" width="47" height="49" class="shows">
            </a>
        </li>

        <li id="btn">
            <a href="http://wpa.qq.com/msgrd?v=3&amp;uin=694510804&amp;site=qq&amp;menu=yes" target="_blank">
                <div class="hides" style="width:161px;display:none">
                    <img src="template/default/images/ll04.png" width="161" height="49">
                </div>
                <img src="template/default/images/l04.png" width="47" height="49" class="shows">
            </a>
        </li>


    </ul>
</div>
<script type="text/javascript" src="template/default/js/jquery.min.js"></script>
<script>

    $(document).ready(function () {
        $("#btn a").hover(function () {
            $(this).children("div.hides").show();
            $(this).children("img.shows").hide();
            $(this).animate({marginRight: '114px'}, '0');

        }, function () {
            $(this).animate({marginRight: '0px'}, '0', function () {
                $(this).children("div.hides").hide();
                $(this).children("img.shows").show();
            });

        });

        $("#top_btn").click(function () {
            if (scroll == "off") return;
            $("html,body").animate({scrollTop: 0}, 600);
        });

        //右侧导航 - 二维码
        $(".youhui").mouseover(function () {
            $(this).children(".2wm").show();
        })
        $(".youhui").mouseout(function () {
            $(this).children(".2wm").hide();
        });


    });
</script>
<!-- 代码部分end -->
<script type="text/javascript" src="template/default/js/jquery.min.js"></script>

<script>


</script>

<script type="text/javascript" th:inline="javascript">


    function addAddress() {
        var params = $('#addressForm').serialize();
        $.ajax({
            url: "/addUser", //后台处理程序
            type: 'post',         //数据发送方式
            // dataType: 'json',
            data: params,         //要传递的数据
            // async: false,
            success: function (res) {
                console.log(res)
                if (res == "用户已存在") {
                    $('#addressMsg').text(res)
                    return;
                }
                var li = $('<li>').html(res.username + "-联系电话：" + res.phone + "-身份证号码：" + res.idCard)
                $('#address_list').append(li)
                $('#addressForm input').val('')

            },
            error: function (r) {
                // $('#allBody').html(r.responseText)
                console.log(r)
            }
        });
        // window.location.href = '/goods?id='+[[${cart.id}]];

    }

    //选择租车人信息
    (function () {
        var $address_radio = $('#address_list').find('input[type=radio]');
        var $addressID = $('#address_id');
        $addressID.val($('#address_list').find('input[type=radio]:checked').val());
        $address_radio.click(function () {
            $addressID.val($(this).val())
        })
    })()


    // //加师机、接送车、
    function submit_order1() {
        var index = 1
        var cartId = [[${cart.id}]]
        var id = $('input[name="tem_address_id"]:checked').val()
        $.ajax({
            url: "submitOrder", //后台处理程序
            type: 'get',         //数据发送方式
            async: true,
            data: "cartId=" + cartId + "&id=" + id,
            success: function (data) {
                // $("#allBody").html(data)
                $("#submitMsg").text(data)
                $('input[name="tem_address_id"]:checked').prop('checked',false)
            },
            error: function (e) {
                console.log(e)
                if (e.status == 500) {
                    window.location.href = '/login'
                }
            }
        });

    }


    function submit_order() {
        var address_id = $("#address_id").val();
        var my_accunt = 0;//我的积分
        var goods_integral = 1;//本商品最多可以用多少积分兑换
        var integel = 20;//多少积分相当于一元
        var crrent_integel = $("#crrent_integel").val();//当前用户填写的积分
        var Regex = /^[0-9]*[1-9][0-9]*$/;//验证是否是整数
        if (crrent_integel != "" && crrent_integel != null) {
            if (!Regex.test(crrent_integel)) {
                alert("使用积分必须是整数");
            } else if (crrent_integel > my_accunt) {
                alert("您填写的积分已经大于自己的积分,请重填");
            } else if (crrent_integel > goods_integral) {
                alert("您填写的积分已经大于当前商品要求使用的最高积分,请重填");
            } else if (crrent_integel % integel != 0) {
                alert("您填写的积分必须是“" + integel + "”的倍数,请重填");
            }
        } else if (address_id == null || address_id == "") {
            alert("地址没有选择");
        } else {
            $("#content").val($("#content").val().substring(0, $("#content").val().length - 1));
            $("#orderForm").attr("action", "payPage");
            $("#orderForm").submit();
        }
    }

    $("#peishiji").click(function () {
        if ($("#peishiji").is(":checked")) {
            $("#content").val($("#content").val() + "配师机+");
        } else {
            $("#content").val($("#content").val().replace("配师机+", ""));
        }
    });

    $("#songchengjieche").click(function () {
        if ($("#songchengjieche").is(":checked")) {
            $("#content").val($("#content").val() + "送车接车+");
        } else {
            $("#content").val($("#content").val().replace("送车接车+", ""));
        }
    });

    $("#xuyaofapiao").click(function () {
        if ($("#xuyaofapiao").is(":checked")) {
            $("#content").val($("#content").val() + "需要发票+");
        } else {
            $("#content").val($("#content").val().replace("需要发票+", ""));
        }
    });


    $("#yejian").click(function () {
        if ($("#yejian").is(":checked")) {
            $("#content").val($("#content").val() + "夜间服务+");
        } else {
            $("#content").val($("#content").val().replace("夜间服务+", ""));
        }
    });

    $("#ext_text").change(function () {
        $("#content").val($("#content").val() + $("#ext_text").val() + "+");
    });

    function getOuterOrInner() {
        var tem_desc = $("#tem_desc").val();//获取地址或者距离
        if (tem_desc == '1') {//三环内
            $("#desc").val("三环内接送机");
            $("#price").val($("#inner_price").val());
            $("#shiji_order").html($("#inner_price").val());
        } else if (tem_desc == '2') {//三环外
            $("#desc").val("三环外接送机");
            $("#price").val($("#outer_price").val());
            $("#shiji_order").html($("#outer_price").val());
        }
    }


</script>
</body>
</html>